package com.bawei.module_player.adapter.provider

import androidx.databinding.DataBindingUtil
import com.bawei.module_player.PlayerEntity
import com.bawei.module_player.databinding.PlayerTitlteViewBinding
import com.bawei.module_player.databinding.PlayerVideoCardBinding
import com.chad.library.adapter.base.provider.BaseItemProvider
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @Author : yaotianxue
 * @Time : On 2023/6/12 11:13
 * @Description : VideoCardProvider
 */
class VideoCardProvider(override val itemViewType: Int, override val layoutId: Int) : BaseItemProvider<PlayerEntity.Item>() {
    override fun convert(helper: BaseViewHolder, item: PlayerEntity.Item) {
        helper.getBinding<PlayerVideoCardBinding>()?.item = item
    }
    override fun onViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        DataBindingUtil.bind<PlayerVideoCardBinding>(viewHolder.itemView)
    }
}